package com.kd.service.admin.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.kd.bean.admin.AdminRec;
import com.kd.dao.admin.IAdminRecDao;
import com.kd.service.admin.IAdminRecService;

/**
 * 管理员给招聘者发送消息
 * 服务层
 * @author ZFC
 *
 */
@Service
@Transactional
public class AdminRecServiceImpl implements IAdminRecService{

	@Autowired
	private IAdminRecDao recDao;
	
	@Override
	public Boolean insertRecJuBaoMessage(AdminRec adminRec) throws Exception {
		
		return recDao.insertRecJuBaoMessage(adminRec)>0;
	}

	@Override
	public PageInfo<AdminRec> queryAllAdminRec_news_status(Integer pageNum, Integer pageSize,Integer recruiter_id) throws Exception {
		PageHelper.startPage(pageNum, pageSize);
		List<AdminRec> list = recDao.queryAllAdminRec_news_status(recruiter_id);
		PageInfo<AdminRec> info = new PageInfo<>(list);
		return info;
	}

	@Override
	public Boolean updateAdminRecRec_news_status(Integer adminRec_news_id, Integer adminRec_news_status)
			throws Exception {
		
		return recDao.updateAdminRecRec_news_status(adminRec_news_id, adminRec_news_status)>0;
	}

}
